home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / c_course.zip / NESTED.C < prev    next >
Text File  |  1989-12-30  |  896b  |  39 lines

  1. main()
  2. {
  3. struct person {
  4.    char name[25];
  5.    int age;
  6.    char status;        /* M = married, S = single */
  7. } ;
  8.  
  9. struct alldat {
  10.    int grade;
  11.    struct person descrip;
  12.    char lunch[25];
  13. } student[53];
  14.  
  15. struct alldat teacher,sub;
  16.  
  17. teacher.grade = 94;
  18. teacher.descrip.age = 34;
  19. teacher.descrip.status = 'M';
  20. strcpy(teacher.descrip.name,"Mary Smith");
  21. strcpy(teacher.lunch,"Baloney sandwich");
  22.  
  23. sub.descrip.age = 87;
  24. sub.descrip.status = 'M';
  25. strcpy(sub.descrip.name,"Old Lady Brown");
  26. sub.grade = 73;
  27. strcpy(sub.lunch,"Yogurt and toast");
  28.  
  29. student[1].descrip.age = 15;
  30. student[1].descrip.status = 'S';
  31. strcpy(student[1].descrip.name,"Billy Boston");
  32. strcpy(student[1].lunch,"Peanut Butter");
  33. student[1].grade = 77;
  34.  
  35. student[7].descrip.age = 14;
  36. student[12].grade = 87;
  37.  
  38. }
  39.